include ApplicationHelper
class Files < ActiveRecord::Base
  belongs_to :message
  belongs_to :user
  belongs_to :project
  belongs_to :category
  after_update :log_file
def log_file
   Log.info(self.project,"<a href=/files/#{self.project.id}/#{self.name}>" + icon(self.name.split(".").last.downcase,16) + self.name + "</a>", 5, "Posted by", self.user) if self.user
end
def session_files
   Files.find(:all,:conditions=>"session_id = '#{self.session_id}'")
end
end
